import React, { Component } from "react";
import PubSub from "pubsub-js";
export default class Son extends Component {
  componentDidMount() {
    PubSub.subscribe("appfb", (topic, data) => {
      console.log("app发布son接收",topic, data);
    });
  }
  render() {
    return (
      <div>
        son
        <button
          onClick={() => {
            PubSub.publish("fp", { housr: "fp发布信息" });
          }}
        >
          按钮点击发布fp话题
        </button>
      </div>
    );
  }
}
